<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Mosaddek">
    <meta name="keyword" content="FlatLab, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
    <link rel="shortcut icon" href="img/favicon.html">

    <title>新增用户</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom styles for this template -->
    <link href="css/style.css" rel="stylesheet">
    <link href="css/style-responsive.css" rel="stylesheet" />

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
      <script src="js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

  <section id="container" class="">
      <!--header start-->
      <header class="header white-bg">
          <div class="sidebar-toggle-box">
              <div data-original-title="" data-placement="right" class="icon-reorder tooltips"></div>
          </div>
          <!--logo start-->
           <a href="#" class="logo">基于web的<span>车辆管理系统</span></a>
          <!--logo end-->
         
          <div class="top-nav ">
              <ul class="nav pull-right top-menu">
                  <li>
                      <input type="text" class="form-control search" placeholder="Search">
                  </li>
                  <!-- user login dropdown start-->
                  <li class="dropdown">
                      <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                          <img alt="" src="img/avatar1_small.jpg">
                          <span class="username">嘿嘿</span>
                          <b class="caret"></b>
                      </a>
                      <ul class="dropdown-menu extended logout">
                          <div class="log-arrow-up"></div>
                          <li><a href="#"><i class=" icon-suitcase"></i>个人资料</a></li>
                          <li><a href="#"><i class="icon-cog"></i>设置</a></li>
                          <li><a href="#"><i class="icon-bell-alt"></i> 通知</a></li>
                          <li><a href="login.html"><i class="icon-key"></i> 退出</a></li>
                      </ul>
                  </li>
                  <!-- user login dropdown end -->
              </ul>
          </div>
      </header>
      <!--header end-->
      <!--sidebar start-->
       <aside>
          <div id="sidebar"  class="nav-collapse ">
              <!-- sidebar menu start-->
              <ul class="sidebar-menu">
                  <li class="active">
                      <a class="" href="index.html">
                          <i class="icon-dashboard"></i>
                          <span>首页</span>
                      </a>
                  </li>
                  <li class="sub-menu">
                      <a href="javascript:;" class="">
                          <i class="icon-book"></i>
                          <span>车辆基本信息管理</span>
                          <span class="arrow"></span>
                      </a>
                      <ul class="sub">
                          <li><a class="" href="carList.html">车辆列表</a></li>
                          <li><a class="" href="addCar.html">新增车辆</a></li>
                      </ul>
                  </li>
                  <li class="sub-menu">
                      <a href="javascript:;" class="">
                          <i class="icon-cogs"></i>
                          <span>车主信息管理</span>
                          <span class="arrow"></span>
                      </a>
                      <ul class="sub">
                          <li><a class="" href="carOwnerList.html">车主列表</a></li>
                          <li><a class="" href="addCarOwner.html">新增车主</a></li>
                        
                      </ul>
                  </li>
                  <li class="sub-menu">
                      <a href="javascript:;" class="">
                          <i class="icon-tasks"></i>
                          <span>车辆管理费</span>
                          <span class="arrow"></span>
                      </a>
                      <ul class="sub">
                          <li><a class="" href="feeList.html">费用列表</a></li>
                          <li><a class="" href="chargeMoney.html">收取管理费</a></li>
                          
                      </ul>
                  </li>
                  <li class="sub-menu">
                      <a href="javascript:;" class="">
                          <i class="icon-th"></i>
                          <span>车辆变更管理</span>
                          <span class="arrow"></span>
                      </a>
                      <ul class="sub">
                          <li><a class="" href="carTransferList.html">车辆变更列表</a></li>
                          <li><a class="" href="addCarTransfer.html">新增车辆变更</a></li>
                      </ul>
                  </li>
                  <li class="sub-menu">
                      <a href="javascript:;" class="">
                          <i class="icon-glass"></i>
                          <span>系统管理</span>
                          <span class="arrow"></span>
                      </a>
                      <ul class="sub">
                          <li><a class="" href="queryOwner.html">查看用户</a></li>
                          <li><a class="" href="ownerManagement.html">用户管理</a></li>
                          <li><a class="" href="quit.html">安全退出</a></li>
                      </ul>
                  </li>
                  <li>
                      <a class="" href="login.html">
                          <i class="icon-user"></i>
                          <span>登录</span>
                      </a>
                  </li>
              </ul>
              <!-- sidebar menu end-->
          </div>
      </aside>
      <!--sidebar end-->
      <!--main content start-->
      <section id="main-content">
          <section class="wrapper">
              <!-- page start-->
              <div class="row">
                  <aside class="profile-nav col-lg-3">
                      <section class="panel">
                          <div class="user-heading round">
                              <a href="#">
                                  <img src="img/profile-avatar.jpg" alt="">
                              </a>
                              <!-- <h1>Jonathan Smith</h1> -->
                              <p>欢迎新用户注册</p>
                          </div>

                          <ul class="nav nav-pills nav-stacked">
                              <li><a href="ownerManagement.html"> <i class="icon-user"></i> 个人信息修改</a></li>
                              <li><a href="#"> <i class="icon-calendar"></i> 近期活动 <span class="label label-danger pull-right r-activity">9</span></a></li>
                              <li  class="active"><a href="profile-edit.html"> <i class="icon-edit"></i> 用户新增</a></li>
                          </ul>

                      </section>
                  </aside>
                  <aside class="profile-info col-lg-9">
                      <section class="panel">
                          <div class="bio-graph-heading">
                              请编辑你的用户信息！
                          </div>
                          <div class="panel-body bio-graph-info">
                              <h1> 个人信息</h1>
                              <form class="form-horizontal" role="form">
                            
                                  <div class="form-group">
                                      <label  class="col-lg-2 control-label">用户名</label>
                                      <div class="col-lg-6">
                                          <input type="text" class="form-control" id="username" placeholder=" ">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label  class="col-lg-2 control-label">用户密码</label>
                                      <div class="col-lg-6">
                                          <input type="password" class="form-control" id="password" placeholder=" ">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label  class="col-lg-2 control-label">密码确认</label>
                                      <div class="col-lg-6">
                                          <input type="password" class="form-control" id="passwordConfirm" placeholder=" ">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label  class="col-lg-2 control-label">用户姓名</label>
                                      <div class="col-lg-6">
                                          <input type="text" class="form-control" id="name" placeholder=" ">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label  class="col-lg-2 control-label">用户性别</label>
                                      <div class="col-lg-6">
                                          <input type="text" class="form-control" id="sex" placeholder=" ">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label  class="col-lg-2 control-label">用户状态</label>
                                      <div class="col-lg-6">
                                          <input type="text" class="form-control" id="condition" placeholder=" ">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label  class="col-lg-2 control-label">用户级别</label>
                                      <div class="col-lg-6">
                                          <input type="text" class="form-control" id="authority" placeholder=" ">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label  class="col-lg-2 control-label">注册时间</label>
                                      <div class="col-lg-6">
                                          <input type="text" class="form-control" id="date" placeholder=" " onclick="jeDate({dateCell:'#date',isTime:true,format:'YYYY-MM-DD hh:mm:ss'})"/>
                                      </div>
                                  </div>

                                  <div class="form-group">
                                      <div class="col-lg-offset-2 col-lg-10">
                                          <div class="col-lg-6" style="float: left">
                                             <button type="submit" class="btn btn-success" onclick="insert();return false;">保存</button>
                                             <button type="reset" class="btn btn-default" style="float: right">取消</button>
                                          </div>
                                      </div>
                                  </div>
                              </form>
                          </div>
                      </section>
                     <!--  <section>
                          <div class="panel panel-primary">
                              <div class="panel-heading"> Sets New Password & Avatar</div>
                              <div class="panel-body">
                                  <form class="form-horizontal" role="form">
                                      <div class="form-group">
                                          <label  class="col-lg-2 control-label">Current Password</label>
                                          <div class="col-lg-6">
                                              <input type="password" class="form-control" id="c-pwd" placeholder=" ">
                                          </div>
                                      </div>
                                      <div class="form-group">
                                          <label  class="col-lg-2 control-label">New Password</label>
                                          <div class="col-lg-6">
                                              <input type="password" class="form-control" id="n-pwd" placeholder=" ">
                                          </div>
                                      </div>
                                      <div class="form-group">
                                          <label  class="col-lg-2 control-label">Re-type New Password</label>
                                          <div class="col-lg-6">
                                              <input type="password" class="form-control" id="rt-pwd" placeholder=" ">
                                          </div>
                                      </div>

                                      <div class="form-group">
                                          <label  class="col-lg-2 control-label">Change Avatar</label>
                                          <div class="col-lg-6">
                                              <input type="file" class="file-pos" id="exampleInputFile">
                                          </div>
                                      </div>

                                      <div class="form-group">
                                          <div class="col-lg-offset-2 col-lg-10">
                                              <button type="submit" class="btn btn-info">Save</button>
                                              <button type="button" class="btn btn-default">Cancel</button>
                                          </div>
                                      </div>
                                  </form>
                              </div>
                          </div>
                      </section> -->
                  </aside>
              </div>

              <!-- page end-->
          </section>
      </section>
      <!--main content end-->
  </section>

    <!-- js placed at the end of the document so the pages load faster -->
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.scrollTo.min.js"></script>
    <script src="js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="assets/jquery-knob/js/jquery.knob.js"></script>
    <script src="js/jedate/jedate.js"></script>

    <!--common script for all pages-->
    <script src="js/common-scripts.js"></script>

    <script type="text/javascript">
    function insert() {
		 var username = $('#username').val(),
		    password = $('#password').val(),
		    passwordConfirm = $('#passwordConfirm').val(),
		    name = $('#name').val(),
		    sex = $('#sex').val(),
		    state = $('#condition').val(),
		    authority = $('#authority').val(),
		    date = $('#date').val();
		 
		if(password != passwordConfirm){
			alert("两次输入的密码不一致，请重新输入！");
			$("input[id='password']").val("");
			$("input[id='passwordConfirm']").val("");
			return false;
		}else{
			var datalist = [{
					username: username,
					password:password,
					name:name,
					sex:sex,
					state:state,
					authority:authority,
					date:date
				}];
			var t = JSON.stringify(datalist);
			$.ajax({
				url: 'user_insert.action',
				type: 'POST',
				dataType: 'json',
				data: "data=" + t,
		
				success: function(data) {
					alert(data.data);
					console.log('success');
					return false;
				},

				error: function(data) {
					alert(data.data);
					return false;
				}
			})							
		}
					
	}
 
    </script>
  </body>
</html>
